<!doctype html>
<html lang="en" dir="ltr" xmlns:th="http://www.thymeleaf.org">
<head th:replace="public/head :: head(${result.searchParam.key})"></head>
<body class="">
<div class="page">
    <div class="flex-fill">
        <!--响应式顶部菜单-->
        <div th:replace="public/topbar :: flexTopbar(4)"></div>
        <div class="my-3 my-md-5">
            <div class="container">
                <div class="row mb-3">
                    <div class="col-3 dropdown d-xl-inline-block d-none">
                        <div class="card card-profile">
                            <div class="card-body text-center">
                                <a href="#" class="nav-link pr-0 leading-none">
                                    <span class="avatar" th:style="'background-image: url(' + ${session.SESSION_BLOGGER.avatar} + ')'"></span>
                                    <span class="ml-2 d-lg-block">
										<span class="text-default" th:text="${session.SESSION_BLOGGER.blogName}">Jane Pearson</span>
									</span>
                                </a>
                            </div>
                            <form action="" method="get" class="card-body">
                                <div class="col-auto">
                                    <h2 class="page-title">
                                        搜索结果
                                    </h2>
                                </div>
                                <div class="col-auto">
                                    <div class="text-muted text-h5 mt-2">共[[${result.getTotalHits()}]]条，耗时[[${result.took}]]</div>
                                </div>
                                <div class="hr-text text-blue">Tags</div>
                                <div class="list-group list-group-transparent mb-3">
                                    <a class="list-group-item list-group-item-action d-flex align-items-center"
                                       th:each="tag : ${result.tags}"
                                        th:href="'/search?key=' + ${result.searchParam.key} + '&tagId=' + ${tag.id}">
                                        [[${tag.name}]]
                                        <small class="text-muted ml-auto" th:text="${tag.docCount}">24</small>
                                    </a>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="col-lg-9">
                        <!--顶部菜单-->
                        <div th:replace="public/topbar :: topbar(4)"></div>
                        <div class="card">
                            <div class="empty" th:if="${result.totalHits} == 0">
                                <div class="empty-icon">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                         viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
                                         stroke-linecap="round" stroke-linejoin="round" class="icon">
                                        <circle cx="11" cy="11" r="8"></circle>
                                        <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
                                    </svg>
                                </div>
                                <p class="empty-title h3">没有搜索到相关结果</p>
                                <div class="empty-action">
                                    <a href="../index.html" class="btn btn-primary">
                                        返回首页
                                    </a>
                                </div>
                            </div>
                            <div class="card-body d-flex flex-column" th:each="article : ${result.articles}">
                                <h4>
                                    <a href="item.html" th:href="@{'/item/' + ${article.id}}" th:text="${article.title}">Spring Cloud --- 服务注册</a>
                                </h4>
                                <div class="text-muted" th:text="${article.content}">
                                    Spring全家桶在我们的开发中占据了越来越重要的位置...
                                </div>
                                <div class="d-flex align-items-center pt-5 mt-auto text-muted">
                                    <div class="col text-muted">
                                        <span class="badge bg-blue" th:each="tag : ${article.tags}" th:text="${tag.name}" style="margin: 0 0.5em;">blue</span>
                                    </div>
                                    <div class="col text-muted text-right" th:text="${#dates.format(article.createTime, 'yyyy-MM-dd')}">2 days ago</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div th:replace="public/footer :: footer"></div>
</div>
</body>
</html>
